 <!DOCTYPE html>
 <html lang="en">
 <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>公司招聘信息</title>
    <link rel="stylesheet" href="/dev/assets/css/geek-job/all-company.css">
    <link rel="stylesheet" href="/dev/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/dev/plugins/layui/layui/css/layui.css">
     <link rel="icon" href="/dev/assets/img/geek-job/wanli.jpg" type="image/x-icon">
 </head>
 <body>
 <div id="nav"></div>
    <div id="wrap" class="page">
        <div class="page-job-wrapper" style="padding-top: 0px;">
            <div class="job-search-wrapper">
                <div class="filter-box">
                    <div class="job-search-form">
                        <span class="city-label">职位类型
                        <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                        </span>
                        <div class="search-input-box">
                            <input autocomplete="on" spellcheck="false" type="text" placeholder="搜索职位、公司" id="input">
                            <a href="#" class="search-map-btn">地图</a>
                            <a href="#" id="search-btn" class="search-btn">搜索</a>
                        </div>
                    </div>
                </div>

                <!-- 筛选分栏 -->
                <div class="filter-condition ">
                    <div class="filter-location">
                        <span class="title-location">公司地点: </span>
                        <span class="content-location">
                                <a href="#" class="">苏州</a>
                                        <a href="#" class="" ka="brand_list_city_100010000">全国</a>
                                        <a href="#" class="" >北京</a>
                                        <a href="#" class="" >上海</a>
                                        <a href="#" class="" >广州</a>
                                        <a href="#" class="" >深圳</a>
                                        <a href="#" class="" >杭州</a>
                                        <a href="#" class="" >天津</a>
                                        <a href="#" class="" >西安</a>
                                        <a href="#" class="" >武汉</a>
                                        <a href="#" class="" >厦门</a>
                                        <a href="#" class="" >长沙</a>
                                        <a href="#" class="" >成都</a>
                                        <a href="#" class="" >郑州</a>
                                        <a href="#" class="" >重庆</a>
                            <a href="javascript:;" class="all-city" ka="brand_list_all_city">全部城市</a>
                        </span>
                    </div>
                    <div class="filter-industry">
                        <span class="title-industry">行业类型: </span>
                        <span class="content-industry">
                                    <a href="#" class="" >不限</a>
                                    <a href="#" class="" >电子商务</a>
                                    <a href="#" class="" >游戏</a>
                                    <a href="#" class="" >媒体</a>
                                    <a href="#" class="" >广告营销</a>
                                    <a href="#" class="" >数据服务</a>
                                    <a href="#" class="" >医疗健康</a>
                                    <a href="#" class="" >生活服务</a>
                                    <a href="#" class="" >O2O</a>
                                    <a href="#" class="" >旅游</a>
                                    <a href="#" class="" >分类信息</a>
                                    <a href="#" class="" >音乐/视频/阅读</a>
                                    <a href="#" class="" >在线教育</a>
                                    <a href="#" class="" >社交网络</a>
                                    <a href="#" class="" >人力资源服务</a>
                                    <a href="#" class="" >企业服务</a>
                                    <a href="#" class="" >信息安全</a>
                                    <a href="#" class="" >智能硬件</a>
                                    <a href="#" class="" >移动互联网</a>
                                    <a href="#" class="" >互联网</a>
                                    <a href="#" class="" >计算机软件</a>
                                    <a href="#" class="" >通信/网络设备</a>
                                    <a href="#" class="" >广告/公关/会展</a>
                                    <a href="#" class="" >互联网金融</a>
                                    <a href="#" class="" >物流/仓储</a>
                                    <a href="#" class="" >贸易/进出口</a>
                                    <a href="#" class="" >咨询</a>
                                    <a href="#" class="" >工程施工</a>
                                    <a href="#" class="" >汽车生产</a>
                                    <a href="#" class="" >其他行业</a>
                        </span>
                    </div>
                    <div class="filter-stage">
                        <span class="title-stage">融资阶段: </span>
                        <span class="content-stage">
                                    <a href="#" class="" >不限</a>
                                    <a href="#" class="" >未融资</a>
                                    <a href="#" class="" >天使轮</a>
                                    <a href="#" class="" >A轮</a>
                                    <a href="#" class="" >B轮</a>
                                    <a href="#" class="" >C轮</a>
                                    <a href="#" class="" >D轮及以上</a>
                                    <a href="#" class="" >已上市</a>
                                    <a href="#" class="" >不需要融资</a>
                        </span>
                    </div>
                    <div class="filter-scale">
                        <span class="title-scale">公司规模: </span>
                        <span class="content-scale">
                                    <a href="#" class="" >不限</a>
                                    <a href="#" class="" >0-20人</a>
                                    <a href="#" class="" >20-99人</a>
                                    <a href="#" class="" >100-499人</a>
                                    <a href="#" class="" >500-999人</a>
                                    <a href="#" class="" >1000-9999人</a>
                                    <a href="#" class="" >10000人以上</a>
                        </span>
                        <a href="#" class="reset" id="reset">清空筛选条件</a>
                    </div>
                </div>

                <!-- 期望分栏 -->
                <div class="expect">
                            <span class="container-login">
                                <img src="/dev/assets/img/geek-job/star.png" alt="">
                                <a href="javascript:void(0)" class="default">根据求职期望推荐</a>
                                    <span class="ops-btns">
                                            <a href="#" class="cur">Java</a>
                                    </span>
                                <a href="#">默认推荐</a>
                            </span>
                </div>

                <!-- 公司分栏 -->
                <div class="company-wrapper">
                    <div class="company-tab-box company-list">
                        <ul class="container-wrapper" id="container-wrapper">

                        </ul>
                    </div>
                </div>
            </div>            
        </div>
    </div>

<script src="/dev/plugins/jquery/jquery.min.js"></script>
<script src="/dev/plugins/bootstrap/js/bootstrap.js"></script>
<script src="/dev/plugins/layui/layui/layui.js"></script>
<script>
    // let params = new URLSearchParams(window.location.search);
    // let JRID = params.get('jrId');

    $(function (){
        $("#nav").load("/dev/views/common/nav.html")

        let Inpu = new URLSearchParams(window.location.search);
        var baseInput = Inpu.get('baseInput');
        if (baseInput!=null || baseInput!=""){
            $("#input").val(baseInput)
        }
        // reqs()
        layui.use(function(){
            var flow = layui.flow;
            // 流加载实例
            flow.load({
                elem: '#container-wrapper', // 流加载容器
                done: function(page, next){ // 执行下一页的回调
                    // 模拟数据插入
                    setTimeout(function(){
                        let inp = $("#input").val()
                        $.ajax({
                            headers:{
                                "id":localStorage.getItem("id"),
                                "token":localStorage.getItem("token")
                            },
                            url: `/dev/allCompany/geekjob`,
                            data: {
                                "jsId": localStorage.getItem("id"),
                                "searchkey": inp
                            },
                            type: "get",
                            success: function (postlist) {
                                console.log(postlist)
                                var lis = [];
                                let number = postlist.data.length;
                                let start = (page - 1) * 12;
                                let end = Math.min(start+12, postlist.data.length)
                                console.log(page)
                                console.log(start)
                                console.log(end)
                                for (let i = start; i < end; i++) {
                                    lis.push( `<li>
                                    <div class="sub-li" >
                                        <a href="#" onclick="conn(${postlist.data[i].jrId})"  class="company-info">
                                            <img src="${postlist.data[i].jrAvatar}" alt="">
                                            <div class="conpany-text">
                                                <h4>${postlist.data[i].companyName}</h4>
                                                <i>${postlist.data[i].runState}</i><i>${postlist.data[i].companyType}</i>
                                            </div>
                                        </a>
                                            <a  class="about-info"  style="cursor: pointer;" >
                                                <p onclick="connection(${postlist.data[i].postId})">热招 <span class="vline"></span> <u class="h">${postlist.data[i].posName}</u>${Math.round(postlist.data[i].payFloor / 1000)}-${Math.round(postlist.data[i].payUpper / 1000)}K</p>
                                            </a>
                                    </div>
                                </li>`)
                                }
                                next(lis.join(''), page < Math.round(number/12));
                            }
                        })
                    }, 520);
                }
            });
        });
    })

    $("#search-btn").click(function (){
        $("#container-wrapper").empty();
        let input = document.getElementById("input").value
        if (input==='') {
            layui.use(function () {
                var flow = layui.flow;
                // 流加载实例
                flow.load({
                    elem: '#container-wrapper', // 流加载容器
                    done: function (page, next) { // 执行下一页的回调
                        // 模拟数据插入
                        setTimeout(function () {
                            let inp = $("#input").val()
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: `/dev/allCompany/geekjob`,
                                data: {
                                    "jsId": localStorage.getItem("id"),
                                    "searchkey": inp
                                },
                                type: "get",
                                success: function (postlist) {
                                    console.log(postlist)
                                    var lis = [];
                                    let number = postlist.data.length;
                                    let start = (page - 1) * 12;
                                    let end = Math.min(start + 12, postlist.data.length)
                                    console.log(page)
                                    console.log(start)
                                    console.log(end)
                                    for (let i = start; i < end; i++) {
                                        lis.push(`<li>
                                    <div class="sub-li" >
                                        <a href="#" onclick="conn(${postlist.data[i].jrId})" class="company-info">
                                            <img src="${postlist.data[i].jrAvatar}" alt="">
                                            <div class="conpany-text">
                                                <h4>${postlist.data[i].companyName}</h4>
                                                <i>${postlist.data[i].runState}</i><i>${postlist.data[i].companyType}</i>
                                            </div>
                                        </a>
                                            <a  class="about-info"  style="cursor: pointer;" >
                                                <p onclick="connection(${postlist.data[i].postId})">热招 <span class="vline"></span> <u class="h">${postlist.data[i].posName}</u>${Math.round(postlist.data[i].payFloor / 1000)}-${Math.round(postlist.data[i].payUpper / 1000)}K</p>
                                            </a>
                                    </div>
                                </li>`)
                                    }
                                    next(lis.join(''), page < Math.round(number / 12));
                                }
                            })
                        }, 520);
                    }
                });
            });
        }else {
            layui.use(function () {
                var flow = layui.flow;
                // 流加载实例
                flow.load({
                    elem: '#container-wrapper', // 流加载容器
                    done: function (page, next) { // 执行下一页的回调
                        // 模拟数据插入
                        setTimeout(function () {
                            let inp = $("#input").val()
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url:`/dev/PostsSearch/search/${inp}`,
                                type:"get",
                                success: function (postlist) {
                                    if (postlist.data == null || postlist.data === []) {
                                        next("", false);

                                        return ;
                                    }
                                    console.log(postlist)
                                    var lis = [];
                                    let number = postlist.data.length;
                                    let start = (page - 1) * 12;
                                    let end = Math.min(start + 12, postlist.data.length)
                                    console.log(page)
                                    console.log(start)
                                    console.log(end)
                                    for (let i = start; i < end; i++) {
                                        let runState=""
                                        if (postlist.data[i].content.runState==0){
                                            runState="未上市"
                                        }else if (postlist.data[i].content.runState==1){
                                            runState="已上市"
                                        }
                                        lis.push(`<li>
                                    <div class="sub-li" >
                                        <a href="#" onclick="conn(${postlist.data[i].content.jrId})" class="company-info">
                                            <img src="${postlist.data[i].content.jrAvatar}" alt="">
                                            <div class="conpany-text">
                                                <h4>${postlist.data[i].highlightFields.companyName==null?postlist.data[i].content.companyName:postlist.data[i].highlightFields.companyName}</h4>
                                                <i>${runState}</i><i>${postlist.data[i].content.companyType}</i>
                                            </div>
                                        </a>
                                            <a  class="about-info"  style="cursor: pointer;" >
                                    <!--     改的id-->
                                                <p onclick="connection(${postlist.data[i].content.id})">热招 <span class="vline"></span> <u class="h">${postlist.data[i].highlightFields.posName==null?postlist.data[i].content.posName:postlist.data[i].highlightFields.posName}</u>${Math.round(postlist.data[i].content.payFloor / 1000)}-${Math.round(postlist.data[i].content.payUpper / 1000)}K</p>
                                            </a>
                                    </div>
                                </li>`)
                                    }
                                    next(lis.join(''), page < Math.round(number / 12));
                                }
                            })
                        }, 520);
                    }
                });
            });
        }
    })

    function conn(num){
        // localStorage.setItem("postId",num);
        window.location=`/dev/views/job/page/jobdetails.html?jrId=${num}`;
    }

    function connection(nums){
        window.location=`/dev/views/job/page/boss.html?posId=${nums}`
    }
</script>
 </body>
 </html>